home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Misc / AnimTester / Source / PreferencesBrain.h < prev    next >
Encoding:
Text File  |  1995-06-12  |  3.1 KB  |  79 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. // This object is the central clearing house for the preferences.  It
  5. // handles I/O between the Preferences Panel controls and it stores stuff
  6. // in the defaults database.  It also tells the app when things change.
  7. // The app can also query it to find the state of various preferences.
  8.  
  9. #import <objc/Object.h>     /* superclass */
  10. #import <appkit/Matrix.h>     /* matrix controls' methods */
  11. #import <appkit/Control.h>     /* various controls' methods */
  12. #import <defaults/defaults.h>    /* preferences (defaults) */
  13. #import <appkit/Slider.h>
  14. #import <stdio.h>        /* strcpy */
  15. #import <stdlib.h>        /* malloc */
  16. #import "GameBrain.h"        /* where to send change alerts */
  17.  
  18.  
  19. @interface PreferencesBrain:Object
  20. {    
  21.     // various controls on the Preferences... Panel
  22.     id    speedButtons;        // buttons to set game speed on pref panel
  23.     id    preferencesPanel;    // preferences panel instance
  24.     id    musicButtons;        // radio buttons for music on/off
  25.     id    effectButtons;        // radio buttons for sound effects on/off
  26.     id  demoSwitch;            // "Demo Sound" switch
  27.     id  alertSwitch;        // "Alerts" switch
  28.     id  autoUnPauseSwitch;    // "Auto Unpause" switch
  29.     id  autoStartSwitch;    // "New Game on Launch" switch
  30.  
  31.     id  gameScreen;            // GameView instance/subclass
  32.     id  gameBrain;            // GameBrain instance
  33.     
  34.     // instance variables to hold preferences and game status:
  35.     int speed;
  36.     BOOL music, effects, alert, demoSound, autoUnPause, autoStart;
  37.     char *defaultPlayerName, *version;    // used for internal purposes.
  38. }
  39.  
  40. - init;                    // designated initializer
  41.  
  42. // methods called by the app to access the various preferences
  43. - (BOOL)firstTimeCheck;    // first time running this version?
  44. - preferencesPanel;        // returns the id of the Preferences Panel
  45. - (int)speed;            // return game speed
  46. - (BOOL)music;            // return music status
  47. - (BOOL)effects;        // return effects status
  48. - setDefaultPlayerName:(char *)aString;    // change default player name
  49. - (const char *)defaultPlayerName;  // return ptr to defaultPlayerName string
  50. - revert:sender;        // return to default values
  51. - setAutoUnPause:(BOOL)al;
  52. - (BOOL)autoUnPause;
  53. - (BOOL)alert;
  54. - (BOOL)demoSound;
  55. - (BOOL)autoStart;
  56. - setAutoStart:(BOOL)al;
  57. - setAlert:(BOOL)al;
  58.  
  59.     
  60. // Interface Builder (IB) methods:
  61. //    (called by various controls on the Preferences Panel)
  62. - readDefaults:sender;        // read preferences from defaults database
  63. - writeDefaults:sender;        // write preferences to defaults database
  64. - speedChange:sender;        // target of speed pref. matrix
  65. - preferences:sender;        // called by Preferences... menu item
  66. - musicChange:sender;        // target of music on/off matrix on pref panel
  67. - effectsChange:sender;        // target of effect on/off matr. on pref panel
  68. - alertChange:sender;        // turn alert panels on/off
  69. - autoStartChange:sender;    // auto start game on launch on/off
  70. - demoSoundChange:sender;    // turn off sound only in demo
  71. - setBack:sender;            // set the background image
  72. - revertBack:sender;        // revert to default background image
  73. - back1:sender;                // call up background #1
  74. - back2:sender;                // call up background #1
  75. - back3:sender;                // call up background #1
  76. - unPauseChange:sender;        // turn off auto un-pausing
  77.  
  78. @end
  79.